angular.module('furion.services.directive', [])

.directive('oaRepeatFinished', ($timeout)->
  {
    restrict: 'A',
    link: (scope, element, attr)->
      if scope.$last
        $timeout ()->
          scope.$emit(attr.oaRepeatFinished)
  }
)

.directive('oaEleRenderFinished', ($timeout)->
  {
    restrict: 'A',
    link: (scope, element, attr)->
      $timeout ()->
        scope.$emit(attr.oaEleRenderFinished)
  }
)

.directive 'clickFocus', ($window)->
  {
    restrict: 'A',
    link: (scope, element, attrs)->
      element.on 'touchstart', ()->
        $('input').blur()
  }